import { stringify } from 'qs';
import request from '../utils/request';


export async function queryService(params) {
    return request.get('/api/service', {params});
}
export async function fetchService(id) {
    return request.get(`/api/service/${id}`);
}
export async function addService(params) {
    return request.post('/api/service', params);
}

export async function changeService(params) {
    if (params.photos) {
        params.photos = params.photos.map((item) => {
            return item.response.data.file;
        });
    }
    return request.put(`/api/service/${params.id}`, params);
}
export async function removeService(params) {
    return request.delete(`/api/service/${params.id}`);
}
export async function queryCategories() {
    return request.get('/api/service_menus');
}
